cmake_minimum_required(VERSION 3.5)

project(dst)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
    message("build for widnows")
    set(WINDOWS 1)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
    message("build for linux")
    set(LINUX 1)
endif()

if(WINDOWS)
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -MT -MP")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -MT -MP")

    include(lib/cmake/opengl.cmake)
    include(lib/cmake/glew.cmake)
    include(lib/cmake/glfw.cmake)
    include(lib/cmake/opencv.cmake)
    include(lib/cmake/eigen.cmake)
elseif (LINUX)
    set(CMAKE_PREFIX_PATH /home/hh/code/lib)
    find_package(OpenCV REQUIRED)
    include_directories(${OpenCV_INCLUDE_DIRS})
    list(APPEND LINK_LIBS ${OpenCV_LIBS})
    find_package(Eigen3 REQUIRED)
    list(APPEND LINK_LIBS Eigen3::Eigen)
    find_package(GLEW REQUIRED)
    list(APPEND LINK_LIBS GLEW::glew)
    find_package(glfw3 REQUIRED)
    list(APPEND LINK_LIBS glfw)
endif()

set(CMAKE_CXX_STANDARD 17)

include_directories(src)

add_subdirectory(src)
add_subdirectory(app)
add_subdirectory(src/render)